package notesDetection.GUI;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URL;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

public class LogoImage extends JPanel{

	private static final long serialVersionUID = 2225327697379167838L;
	private BufferedImage image;

    public LogoImage(URL filename) {
    	image = loadImage(filename);
    }

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(image, 0, 0, null); // see javadoc for more info on the parameters            
    }
    
    public static BufferedImage loadImage(URL filename)
    {
        try {                
            return ImageIO.read(filename);
         } catch (IOException ex) {
            System.err.println(ex.getMessage());
            return null;
         }
    }
}
